package cn.ilikes.tools.hbase.jpa.metadatas.sub.configs;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

@XmlRootElement
public class IndexConfigs implements Serializable {

	private static final long serialVersionUID = 1141918330103221921L;
	@XmlElement
	private List<Indexfactory> factorys = new ArrayList<Indexfactory>();

	public List<Indexfactory> getFactorys() {
		return factorys;
	}

	public void setFactorys(List<Indexfactory> factorys) {
		this.factorys = factorys;
	}

	public Indexfactory findFactoryByName(String persistenceUnitName) {
		for (Indexfactory factory : factorys) {
			if (factory.getName().equals(persistenceUnitName))
				return factory;

		}
		return null;
	}

}
